Package es.csic.iiia.fabregues.dip.comm
Class Comm
java.lang.Object
es.csic.iiia.fabregues.dip.comm.Comm
public class Comm
extends java.lang.Object
Deals with high level communication (String[]) from the DAIDE language
- Author:
- Angela Fabregues, IIIA-CSIC, fabregues@iiia.csic.es
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
getBuildTimeLimit()
Returns the deadline for build phases (WIN) in milliseconds.GameState
getGameState()
int
getMoveTimeLimit()
Returns the deadline for move phases (SPR and FAL) in milliseconds.int
getRetreatTimeLimit()
Returns the deadline for retreat phases (SUM and AUT) in milliseconds.void
handleReceivedMessage(java.lang.String[] message)
Receives a message from the game managervoid
restart(java.lang.String powerName, java.lang.String passcode)
Reconnecting to a game as the player with the following powerName and passcodevoid
sendMessage(java.lang.String[] msg)
Sends a message to the game managervoid
start()
Connecting to a new game as either a player or an observervoid
stop()
-
Constructor Details
-
Comm
Communication. Notice that an IComm like DaideComm is necessary to stablish communication.- Parameters:
game
- manager ipgame
- manager portclient
- nameclient
- reference- Throws:
CommException
java.io.IOException
-
-
Method Details
-
start
Connecting to a new game as either a player or an observer- Throws:
CommException
StartingCommException
-
restart
Reconnecting to a game as the player with the following powerName and passcode- Parameters:
powerName
-passcode
-- Throws:
CommException
-
sendMessage
Sends a message to the game manager- Parameters:
msg
-- Throws:
CommException
-
handleReceivedMessage
public void handleReceivedMessage(java.lang.String[] message)Receives a message from the game manager -
stop
public void stop() -
getGameState
-
getMoveTimeLimit
public int getMoveTimeLimit()Returns the deadline for move phases (SPR and FAL) in milliseconds. -
getRetreatTimeLimit
public int getRetreatTimeLimit()Returns the deadline for retreat phases (SUM and AUT) in milliseconds. -
getBuildTimeLimit
public int getBuildTimeLimit()Returns the deadline for build phases (WIN) in milliseconds.
-